//
//  DIYButton.m
//  TTDT_1
//
//  Created by lanou3g on 15/9/8.
//  Copyright (c) 2015年 zhengyl. All rights reserved.
//

#import "DIYButton.h"
#import "Define.h"
@implementation DIYButton

-(void)setFrame:(CGRect)frame{
    [super setFrame:frame];
    [_image removeFromSuperview];
    [_textlabel removeFromSuperview];
    
    CGFloat height = kTitleHeight / 13;
    
    _textlabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.width)];
    _textlabel.textAlignment = NSTextAlignmentCenter;
    _textlabel.font = [UIFont boldSystemFontOfSize:15];
    [self addSubview:_textlabel];
    
    _image = [[UIImageView alloc]initWithFrame:CGRectMake(0, frame.size.height - height, frame.size.width, frame.size.height - frame.size.width)];
    [self addSubview:_image];
    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, height)];
    view.backgroundColor = [UIColor blueColor];
    view.alpha = 0.4;
    [_image addSubview:view];
}





@end
